<?php

use Biz\service\brand\BrandCustomCategory;
use Biz\service\brand\Brand;

/**
 * 品牌主页-品牌自定义分类
 * Class GetCustomCategoryAction
 */
class GetCustomCategoryAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    public function main()
    {
        $brandUid = $this->getRequest()->getQuery('uid', 0);
        $list = [];
        $brandInfo = Brand::getBrandInfosByUid($brandUid);
        if ($brandInfo) {
            $brandInfo = array_shift($brandInfo);
            $list = BrandCustomCategory::getCategoryList($brandInfo['id']);

        }
        $this->setSuccess(['list' => $list]);
    }
}